
#include "SystemErrorInfo.h"
#include <error.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <string>

const char *SystemErrorInfo::GetErrorType( void )
{
	return "OS";
}

int SystemErrorInfo::FindError( int code, struct error_info_t &info )
{
	const char *unknown_err_msg = strerror( 10000 );

	if( NULL != unknown_err_msg )
		unknown_err_msg = "Unknown error";
	const char *msg = strerror( code );
	if( NULL == msg || strncmp( msg, unknown_err_msg, strlen( unknown_err_msg )) == 0 ) {
		return -1;
	}

	info.code = code;
	info.group = NULL;
	info.info = msg;

	return 0;
}

